package com.bbc.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bbc.R;
import com.bbc.base.BaseRecAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/9/27.
 */

public class QianAdapter extends BaseRecAdapter<String> {
    List<String> mList;

    public QianAdapter(ArrayList<String> lists) {
        this.mList = lists;
        notifyDataSetChanged();
    }

    @Override
    protected void onItemClick(View v, int position) {

    }

    @Override
    protected BaseViewHolder getViewHolder(View itemView) {
        return new QianHolder(itemView);
    }

    @Override
    protected View getItemView(ViewGroup parent) {
        return LayoutInflater.from(parent.getContext()).inflate(R.layout.item_home_fragment, null, false);
    }

    class QianHolder extends BaseViewHolder {

        private final TextView mTvName;

        public QianHolder(View itemView) {
            super(itemView);
            mTvName = itemView.findViewById(R.id.tv_test_name);
        }

        @Override
        public void setData(String s, int position) {
            String s1 = mList.get(position);
            mTvName.setText(s1);
        }
    }

}
